import React from 'react'



import  SearchHeader from './SearchHeader/SearchHeader'

import  SearchList from './SearchList/SearchList'


import  api from '../../api/index'

// console.log(api.search.getSearchData)

let   {getSearchData}  =api.search
export  default  class  SearchIndex  extends  React.Component {


    constructor(props) {
        super(props) 
        this.state={
            searchDataList:[]
        }

    
    }


    componentDidMount() {
        let content=this.props.match.params.id
        console.log(content)

        getSearchData(content).then(res=>{
            console.log(res)
            this.setState({
                searchDataList:res.data
            })
        })
    }

    render(){
    


        return(
            <div>
               <SearchHeader  myhistory={this.props.history} name='xxx'/>
               <SearchList data={this.state.searchDataList} />
            </div>
        )
    }
}